﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// SYS_CompanyInfo数据模型对象
    /// </summary>
    [Serializable]
    public partial class SYS_CompanyInfoMod: IEntity, IEntityTypeBuilder<SYS_CompanyInfoMod>
    {

        //属性存储数据的变量
        private string _companyID;
        /// <summary>
        /// 部门名称
        /// </summary>
        private string _companyName;
        private string _city;
        private string _dataBaseName;
        private DateTime? _createTime;
        private string _remark;
        private string _connString;
        private string _province;
        private bool? _uACutPower;
        private int _regionMode;
        private string _parentID;
        
        /// <summary>
        /// 部门id
        /// </summary>
        public string CompanyID
        {
            get { return this._companyID; }
            set { this._companyID = value; }
        }
        /// <summary>
        /// 部门名称
        /// </summary>
        public string CompanyName
        {
            get { return this._companyName; }
            set { this._companyName = value; }
        }
        /// <summary>
        /// 城市
        /// </summary>
        public string City
        {
            get { return this._city; }
            set { this._city = value; }
        }
        /// <summary>
        /// DataBaseName
        /// </summary>
        public string DataBaseName
        {
            get { return this._dataBaseName; }
            set { this._dataBaseName = value; }
        }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime
        {
            get { return this._createTime; }
            set { this._createTime = value; }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark
        {
            get { return this._remark; }
            set { this._remark = value; }
        }
        /// <summary>
        /// ConnString
        /// </summary>
        public string ConnString
        {
            get { return this._connString; }
            set { this._connString = value; }
        }
        /// <summary>
        /// Province
        /// </summary>
        public string Province
        {
            get { return this._province; }
            set { this._province = value; }
        }
        /// <summary>
        /// UACutPower
        /// </summary>
        public bool? UACutPower
        {
            get { return this._uACutPower; }
            set { this._uACutPower = value; }
        }
        /// <summary>
        /// RegionMode
        /// </summary>
        public int RegionMode
        {
            get { return this._regionMode; }
            set { this._regionMode = value; }
        }
        /// <summary>
        /// ParentID
        /// </summary>
        public string ParentID
        {
            get { return this._parentID; }
            set { this._parentID = value; }
        }
        
        /// <summary>
        /// 对比两个SYS_CompanyInfo数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的SYS_CompanyInfo数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成SYS_CompanyInfo数据模型对象
            SYS_CompanyInfoMod sYS_CompanyInfoMod = obj as SYS_CompanyInfoMod;
            //判断是否转换成功
            if (sYS_CompanyInfoMod == null) return false;
            //进行匹配属性的值
            return
                //判断CompanyID是否一致
                this.CompanyID == sYS_CompanyInfoMod.CompanyID &&
                //判断CompanyName是否一致
                this.CompanyName == sYS_CompanyInfoMod.CompanyName &&
                //判断City是否一致
                this.City == sYS_CompanyInfoMod.City &&
                //判断DataBaseName是否一致
                this.DataBaseName == sYS_CompanyInfoMod.DataBaseName &&
                //判断CreateTime是否一致
                this.CreateTime == sYS_CompanyInfoMod.CreateTime &&
                //判断Remark是否一致
                this.Remark == sYS_CompanyInfoMod.Remark &&
                //判断ConnString是否一致
                this.ConnString == sYS_CompanyInfoMod.ConnString &&
                //判断Province是否一致
                this.Province == sYS_CompanyInfoMod.Province &&
                //判断UACutPower是否一致
                this.UACutPower == sYS_CompanyInfoMod.UACutPower &&
                //判断RegionMode是否一致
                this.RegionMode == sYS_CompanyInfoMod.RegionMode &&
                //判断ParentID是否一致
                this.ParentID == sYS_CompanyInfoMod.ParentID;
        }
        /// <summary>
        /// 将当前SYS_CompanyInfo数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将SYS_CompanyInfo数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将CompanyID进行按位异或运算处理
                (this.CompanyID == null ? 2147483647 : this.CompanyID.GetHashCode()) ^
                //将CompanyName进行按位异或运算处理
                (this.CompanyName == null ? 2147483647 : this.CompanyName.GetHashCode()) ^
                //将City进行按位异或运算处理
                (this.City == null ? 2147483647 : this.City.GetHashCode()) ^
                //将DataBaseName进行按位异或运算处理
                (this.DataBaseName == null ? 2147483647 : this.DataBaseName.GetHashCode()) ^
                //将CreateTime进行按位异或运算处理
                (this.CreateTime == null ? 2147483647 : this.CreateTime.GetHashCode()) ^
                //将Remark进行按位异或运算处理
                (this.Remark == null ? 2147483647 : this.Remark.GetHashCode()) ^
                //将ConnString进行按位异或运算处理
                (this.ConnString == null ? 2147483647 : this.ConnString.GetHashCode()) ^
                //将Province进行按位异或运算处理
                (this.Province == null ? 2147483647 : this.Province.GetHashCode()) ^
                //将UACutPower进行按位异或运算处理
                (this.UACutPower == null ? 2147483647 : this.UACutPower.GetHashCode()) ^
                //将RegionMode进行按位异或运算处理
                this.RegionMode.GetHashCode() ^
                //将ParentID进行按位异或运算处理
                (this.ParentID == null ? 2147483647 : this.ParentID.GetHashCode());
        }
        /// <summary>
        /// 将当前SYS_CompanyInfo数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前SYS_CompanyInfo数据模型对象转换成字符串副本
            return
                "[" +
                //将CompanyID转换成字符串
                this.CompanyID + "," +
                //将CompanyName转换成字符串
                this.CompanyName + "," +
                //将RegionMode转换成字符串
                this.RegionMode + "," +
                //将ParentID转换成字符串
                this.ParentID +
                "]";
        }

        public void Configure(EntityTypeBuilder<SYS_CompanyInfoMod> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            {
                entityBuilder.ToTable("SYS_CompanyInfo");
                entityBuilder.HasComment("设备管理");
                entityBuilder.HasKey(e => e.CompanyID);
            }
        }
    }
}
